/**
* @author Ashish Gupta
* CVSSP, University of Surrey
* Copyright (c) 2010 Ashish Gupta
* All rights reserved.
*/
/**
 * 
 */
package projFn;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

/**
 * @author Ashish
 *
 */
public class ImageSet {
	private ArrayList<String> imageName = new ArrayList<String>();
	private ArrayList<Integer> classLabel = new ArrayList<Integer>();
	/**
	 * @param imageName the imageName to set
	 */
	public void setImageName(ArrayList<String> imageName) {
		this.imageName = imageName;
	}
	/**
	 * @return the imageName
	 */
	public ArrayList<String> getImageName() {
		return imageName;
	}
	/**
	 * @param classLabel the classLabel to set
	 */
	public void setClassLabel(ArrayList<Integer> classLabel) {
		this.classLabel = classLabel;
	}
	/**
	 * @return the classLabel
	 */
	public ArrayList<Integer> getClassLabel() {
		return classLabel;
	}
	
	public void read(String imageSetFileName) throws IOException{
		File file = new File(imageSetFileName);
		FileReader fr = new FileReader(file);
		BufferedReader br = new BufferedReader(fr);
		String line = null;
		while((line = br.readLine())!=null){
			String[] inLine = line.split("\t");
			this.imageName.add(inLine[0]);
			this.classLabel.add(Integer.parseInt(inLine[1]));
		}
		br.close();
		fr.close();
	}
}
